import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.select import Select
x="美的"
testCase = "DBshop011商品管理管理商品搜索商品"

firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu2(firefox,'商品管理','管理商品')

firefox.find_element_by_xpath("//input[@name='goods_name']").send_keys(x)
firefox.find_element_by_xpath("/html/body/div[2]/div/div[2]/table/tbody/tr[1]/td[9]/p/button/i").click()


# 断言
s=firefox.find_element_by_xpath("//body").text
l="商品数："
r="\)"
order_State=reGetString(s,l,r)
print(order_State) #order_State 是实际值
yuqi="1" #这是预期值
#检查点
if yuqi==order_State:
    writeLog("%s 测试通过" % testCase)
else:
    writeLog("%s 测试不通过" % testCase)
    getPhoto(firefox)
firefox.quit()
